package.path = package.path .. ';./protobuf/?.lua;./protobuf/luascript/?.lua'  

require "Person_pb"

local msg = Person_pb.Person()
msg.id = 100
msg.name = "foo"
msg.email = "bar"

local pb_data = msg:SerializeToString()  -- Parse Example

print("create:", msg.id, msg.name, msg.email, pb_data)

local msg1 = Person_pb.Person()
msg1:ParseFromString(pb_data)
print("parser:", msg1.id, msg1.name, msg1.email, pb_data) 
